package pojo;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;
import java.util.Optional;

@Data
public class ConfigPoJo {

    private String resultPath;
    private String sysInterfaceExcelPath;
    private String sysIp;
    private String downloadLinuxFile;
    private String logSavePath;
    private Integer postmanNumber;
    private String debug;
    private String filterTimeOut;
    private Integer exampleMax;
    private String compa;
    private String compaIp;

    public String getFilterTimeOut() {
        return filterTimeOut;
    }

    public void setFilterTimeOut(String filterTimeOut) {
        this.filterTimeOut = filterTimeOut;
    }

    private List<LinuxAccount> linuxList;

    public String getResultPath() {
        resultPath = Optional.ofNullable(resultPath).orElse("");
        return resultPath;
    }

    public void setResultPath(String resultPath) {
        this.resultPath = resultPath;
    }

    public String getSysInterfaceExcelPath() {
        sysInterfaceExcelPath = Optional.ofNullable(sysInterfaceExcelPath).orElse("");
        return sysInterfaceExcelPath;
    }

    public void setSysInterfaceExcelPath(String sysInterfaceExcelPath) {
        this.sysInterfaceExcelPath = sysInterfaceExcelPath;
    }

    public String getSysIp() {
        sysIp = Optional.ofNullable(sysIp).orElse("");
        return sysIp;
    }

    public void setSysIp(String sysIp) {
        this.sysIp = sysIp;
    }

    public List<LinuxAccount> getLinuxList() {
        linuxList = Optional.ofNullable(linuxList).orElse(new ArrayList<>());
        return linuxList;
    }

    public void setLinuxList(List<LinuxAccount> linuxList) {
        this.linuxList = linuxList;
    }

    public String getDownloadLinuxFile() {
        downloadLinuxFile = Optional.ofNullable(downloadLinuxFile).orElse("");
        return downloadLinuxFile;
    }

    public void setDownloadLinuxFile(String downloadLinuxFile) {
        this.downloadLinuxFile = downloadLinuxFile;
    }

    public String getLogSavePath() {
        logSavePath = Optional.ofNullable(logSavePath).orElse("");
        return logSavePath;
    }

    public void setLogSavePath(String logSavePath) {
        this.logSavePath = logSavePath;
    }

    public Integer getPostmanNumber() {
        postmanNumber = Optional.ofNullable(postmanNumber).orElse(0);
        return postmanNumber;
    }

    public void setPostmanNumber(Integer postmanNumber) {
        this.postmanNumber = postmanNumber;
    }

    public String getDebug() {
        debug = Optional.ofNullable(debug).orElse("");
        return debug;
    }

    public void setDebug(String debug) {
        this.debug = debug;
    }

    public boolean isDebug() {
        return "y".equals(getDebug().toLowerCase());
    }

    public Integer getExampleMax() {
        return exampleMax;
    }

    public void setExampleMax(Integer exampleMax) {
        this.exampleMax = exampleMax;
    }

    public String getCompa() {
        compa = Optional.ofNullable(compa).orElse("");
        return compa;
    }

    public void setCompa(String compa) {
        this.compa = compa;
    }

    public String getCompaIp() {
        compaIp = Optional.ofNullable(compaIp).orElse("");
        return compaIp;
    }

    public void setCompaIp(String compaIp) {
        this.compaIp = compaIp;
    }
}
